import Foundation

struct Book: Codable {
    var bookId: String
    var userId: String
    var timestamp: String
    var timestampInteger: Int
    var state: Int
    
    var bookName: String
    var tag: String
    var requirePrice: Int
    
    var author: String
    var course: String
    var description: String
    
    var imageId: [String]
}

struct BookCollection: Codable {
    var collection: [Book]
}

let DefaultBook = Book(bookId: "B6579c20f05c2c",
                       userId: "U657722566f325",
                       timestamp: "2023-12-13 23:46:19",
                       timestampInteger: 1702482379,
                       state: 1,
                       
                       bookName: "概率统计教程（第2版）",
                       tag: "有笔记",
                       requirePrice: 1500,
                       
                       author: "邢家省、马健、刘明菊",
                       course: "概率统计A、概率统计B",
                       description: "2023年秋季学期上课用的",
                       imageId: [
                            "I6579c4fc2597d"
                       ])

struct Book_Sell: Codable {
    var bookId: String
    var userId: String
    var timestamp: String
    var timestampInteger: Int
    var state: Int
    
    var bookName: String
    var tag: String
    var requirePrice: Int
    
    var author: String
    var course: String
    var description: String
    
    var imageId: [String]
    
    var tradeCount: Int
}

struct Book_SellCollection: Codable {
    var collection: [Book_Sell]
}

let DefaultBook_Sell = Book_Sell(bookId: "B6579c20f05c2c",
                       userId: "U657722566f325",
                       timestamp: "2023-12-13 23:46:19",
                       timestampInteger: 1702482379,
                       state: 1,
                       
                       bookName: "概率统计教程（第2版）",
                       tag: "有笔记",
                       requirePrice: 1500,
                       
                       author: "邢家省、马健、刘明菊",
                       course: "概率统计A、概率统计B",
                       description: "2023年秋季学期上课用的",
                       imageId: [
                            "I6579c4fc2597d"
                       ],
                                 
                       tradeCount: 1)
